---
sidebar_position: 2
---
import UniqueIds from '../../src/demos/uniqueIds'

# Adding unique ids to rows

Having a unique id on each row can be achieved using both the `createRow` and `duplicateRow` props.

Try deleting, creating, or duplicating rows:

<UniqueIds />

```tsx
<DataSheetGrid
  createRow={() => ({ id: genId() })}
  duplicateRow={({ rowData }) => ({ ...rowData, id: genId() })}
  rowKey="id"
/>
```
